package cn.jinjimi.app.modules.notify.notifications;

import com.google.gson.annotations.SerializedName;
import cn.jinjimi.app.bean.RouterConstants;

/**
 * Created by zhenhua on 16/5/19.
 */
public class PushDTO {

    public static final int TYPE_IM = 0;

    public static final int TYPE_SIMPLE = 3;

    public static final int TYPE_ARTICLE = 1;

    public static final int TYPE_PRODUCT = 2;

    public static final int TYPE_UPDATE = 100;


    public static final int LIMIT_ANYONE = 0;

    public static final int LIMIT_LOGIN = 1;

    public static final int LIMIT_VIP = 2;


    public static final int FROM_LEANCLOUD = 1;

    public static final int FROM_XGPUSH = 2;

    public static final int FROM_UMENG = 3;

    public int id;

    public int type;

    public String title;

    public String alert;

    public String source;

    public String url;

    public int limit;

    public int fromSorce;

    @SerializedName("_expiration_time")
    public String expireTimeString;

    public int getType() {
        return type;
    }

    public String getSource() {
        return source;
    }

    public String getUrl() {
        return url == null ? RouterConstants.getNativeRouter(RouterConstants.MAIN_INDEX) : url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public int getLimit() {
        return limit == 0 ? LIMIT_ANYONE : limit;
    }

    public void setType(int type) {
        this.type = type;
    }

    public void setFromSorce(int fromSorce) {
        this.fromSorce = fromSorce;
    }

    public int getFromSorce() {
        return fromSorce;
    }
}
